<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script>
        class Person {
            constructor(name, age) {
                this.name = name;
                this.age = age;
            }
            showName(){
                alert(this.name);
            }
            showAge(){
                alert(this.age);
            }
        }

        class Stu extends Person {
            constructor(name, age, job) {
                super(name, age);
                this.job = job;
            }
            showJob(){
                alert(this.job);
            }
        }

        let p = new Stu('chen', 22, '搬砖');
        p.showName();
        p.showAge();
        p.showJob();

    </script>

</head>
<body>

</body>
</html>